{% extends 'base.html' %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block main %}
    <main class="col-md-8">
        <div class="card">
            <nav class="card-header">
                <a href="{% url 'forum:index' %}">django forum demo</a>
                >
                {% if category %}
                    <a href="{% url 'forum:category_posts' category.slug %}">{{ category }}</a>
                    >
                {% endif %}
                <a>发布新帖子</a>
            </nav>
            <div class="card-block">
                {% crispy form %}
            </div>
        </div>
    </main>
{% endblock main %}

{% block script %}
    <script>
        $('#id_create_form').submit(function () {
            $('#submit-id-submit').attr('disabled', true).val('发布中...');
        })
    </script>
{% endblock script %}